#ifndef _RECTANGLEARRAY_H_
#define _RECTANGLEARRAY_H_


#include "rectangleH.h"

//TODO: Remove this from the project.

class RectangleArray
{
		Rectangl * m_arr[10];
		int size;
		int flagInitilization;
        
public:

	RectangleArray()
	{
		size = 0;
		flagInitilization = 0;
	}

	    void Initialization()
		{
			for(int i=0; i<10; i++)
				m_arr[i] = NULL;

			flagInitilization++;

		}

		
		int getSize() 
		{	
			int counter=0;
			
			if(flagInitilization==0)
			{
			  cerr << "You need to Initilize the array first !" << endl;
			  Initialization();
			}
			
			for(int i=0; i<10; i++)
			{ 
				if(m_arr[i] != NULL)
					counter++;
			}

		  return counter;
		}



		bool set(int index)
		{
			if(index < 0 || index > 9)
			{
				cerr << "Error: Index is out if bounds" << endl;
			    return false;
			}

			m_arr[index] = new Rectangl;
			return true;
		}
		
		
		bool get(int index, Rectangl &returned_val)
		{
			if(m_arr[index] == NULL)
			{
				cerr << "Error: Attempt to access uninitialized array" << endl;
				return false;
			}

			if(index < 0 || index > 9)
			{
				cerr << "Error: Index is out if bounds" << endl;
			    return false;
			}

			//returned_val = m_arr[index];


		}
		
		//bool set(int index, int value);
		//bool get(int index, int &returned_val);
		//bool expand( int new_size);
};



#endif